import React from 'react';
import { Input, Form, Button, Col, Row, DatePicker } from 'antd';

/**
 * @description: 创建
 * @author: xiaoxujs
 * @updata: xiaoxujs（2021-07-19） 创建
 */

const SelectModule = ({handleSelect}) => {
    const [form] = Form.useForm()
    const { resetFields } = form
    const onFinish = (values) => {
        handleSelect(values)
    }
    //重置
    const handleReset = () => {
        handleSelect({})
        resetFields();
        // handleSelectReset();
    }
    return <Form
        labelCol={{ span: 8 }}
        wrapperCol={{ span: 16 }}
        onFinish={onFinish}
        form = {form}
    >
        <Row>
            <Col span={8}>
                <Form.Item name="clientName" label="客户名称" hasFeedback>
                    <Input />
                </Form.Item>
            </Col>
            <Col span={8}>
                <Form.Item name="conNo" label="合同编号">
                    <Input />
                </Form.Item>
            </Col>
            <Col span={8}>
                <Form.Item name="actAccountsDate" label="到账日期">
                    <DatePicker />
                </Form.Item>
            </Col>
        </Row>
        <Row>
            <Col span={20}></Col>
            <Col span={4}>
                <Form.Item {...tailLayout}>
                    <Button onClick={handleReset}>重置</Button>
                    <Button type="primary" htmlType="submit">
                        确定
                    </Button>
                </Form.Item>
            </Col>
        </Row>
    </Form>
}

const tailLayout = {
    wrapperCol: { offset: 8, span: 16 },
};


export default SelectModule